package com.mi.mapper;

import com.mi.entity.AdminEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminMapper {

    /**
     * 根据条件查询管理员
     * @param adminEntity
     * @return
     */
    public List<AdminEntity> queryAdmins(AdminEntity adminEntity);

    /**
     * 根据条件查询管理员
     * @param adminEntity
     * @return
     */
    public List<AdminEntity> queryAdmin(AdminEntity adminEntity);

    /**
     * 管理员登录
     * @param adminEntity
     * @return
     */
    public AdminEntity login(AdminEntity adminEntity);

    /**
     * 用户名唯一校验
     * @param adminEntity
     * @return
     */
    public AdminEntity soleAdmin(AdminEntity adminEntity);

    /**
     * 添加管理员
     * @param adminEntity
     * @return
     */
    public boolean addAdmin(AdminEntity adminEntity);

    /**
     * 删除管理员
     * @param aid
     * @return
     */
    public boolean delAdmin(@Param("aid") String[] aid);

    /**
     * 修改管理员
     * @param adminEntity
     * @return
     */
    public boolean updAdmin(AdminEntity adminEntity);


    public boolean updPass(AdminEntity adminEntity);

    /**
     * 修改管理员状态
     * @param adminEntity
     * @return
     */
    public boolean updAdminStatus(AdminEntity adminEntity);

    /**
     * 添加用户角色
     * @param aid
     * @param rid
     * @return
     */
    boolean addRoleAdmin(@Param("aid") int aid,@Param("rid") String rid);

    /**
     * 删除用户角色对应信息
     * @param aid
     * @return
     */
    boolean delRoleAdmin(int aid);

}
